﻿using System.IO;

using Microsoft.Coding4Fun.TweetCraft.Twitter;
using Microsoft.Coding4Fun.TweetCraft.Wow;

using NUnit.Framework;

namespace Microsoft.Coding4Fun.TweetCraft.Tests
{
    [TestFixture]
    public class UserPictureConverterTest
    {
        private const string UserPicturePath = "rgabostyle.jpg";
        private const string DestinationPath = "rgabostyle.tga";

        private UserPictureConverter userPictureConverter;

        [Test]
        public void SimpleUserPictureConverterTest()
        {
            this.TestConverter<WorldOfWarcraftTargaConverter>();
        }

        private void TestConverter<TUserPictureConverter>() where TUserPictureConverter : UserPictureConverter, new()
        {
            userPictureConverter = new TUserPictureConverter();

            bool result = userPictureConverter.Convert(UserPicturePath, DestinationPath);

            Assert.IsTrue(result);
            Assert.IsTrue(File.Exists(DestinationPath));

            File.Delete(DestinationPath);
        }
    }
}
